package com.zcz.umengpush.controller;

import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 王卫帅
 */
@Controller
@RequestMapping("1/")
public class ZuulTestCtl {

    @RequestMapping("1")
    @ResponseBody
    public String aa (HttpServletRequest request, HttpServletResponse response){
        //获取网络协议

        String networkProtocol = request.getScheme();

        //网络IP

        String ip = request.getServerName();

        //端口号

        int port = request.getServerPort();

        //项目发布路径

        String webApp = request.getContextPath();
        String ips = request.getRemoteAddr();
        System.err.println(ips);
        String urlPrefix = networkProtocol+"://"+ip+":"+port+webApp;
        System.err.println(urlPrefix);
        System.err.println("***********");
        return "aa";
    }
}
